#ifndef TRACER_H
#define TRACER_H

#include "Point3D.h"
#include "ShadeRec.h"
#include "Scene.h"
#include "BVH.h"

namespace Engine
{
	class Tracer
	{
	public:
		friend class IrradianceCache;
		virtual bool TraceRay(Ray& currentRay, ShadeRec& sr, bool p_shadowTestray = false) = 0;

		Tracer()
		{
			accelerated = false;
		}


		virtual bool TraceRay(const Point3D& o, const Point3D& d, ShadeRec& sr)
		{
			return false;
		}

		virtual bool TraceRay(Point3D& o, Point3D& d, int& depth, ShadeRec& sr)
		{
			return false;
		}

		virtual bool TraceRay(Point3D& o, Point3D& d, float& tmin, int& depth, ShadeRec& sr)
		{
			return false;
		}

		void UseAccelerationStructure()
		{
			accelerated = true;
		}

		void DontUseAccelerationSturcture()
		{
			accelerated = false;
		}

		Scene* GetScene()
		{
			return sceneObjects;
		}

		void SetScene(Scene* p_currentScene)
		{
			sceneObjects = p_currentScene;
		}


	protected:
		bool accelerated;
		Scene *sceneObjects;
		BVH *accelerationStructure;
	};

}

#endif // !TRACER_H
